package cn.shyouchi.wuguanjia.android.ui.home.security.thread.message;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.shyouchi.wuguanjia.android.R;
import cn.shyouchi.wuguanjia.android.base.BaseFragment;
import cn.shyouchi.wuguanjia.android.ui.home.security.thread.message.matter.MatterNoticeActivity;
import cn.shyouchi.wuguanjia.android.ui.home.security.thread.message.simplenotice.SampleNoticeActivity;
import cn.shyouchi.wuguanjia.android.widget.TopBar;

/**
 * A simple {@link Fragment} subclass.
 */
public class MessageCenterFragment extends BaseFragment {


    @BindView(R.id.topBar)
    TopBar mTopBar;
    @BindView(R.id.rv_msg_section)
    RecyclerView mRvMsgSection;

    MsgSectionAdapter mMsgSectionAdapter;

    List<MsgSection> mMsgSections = new ArrayList<>();

    @Override
    public void initInjector() {

    }

    @Override
    public int initContentView() {
        return R.layout.fragment_message_center;
    }

    @Override
    public void getBundle(Bundle bundle) {

    }

    @Override
    public void initUI(View view) {
        ButterKnife.bind(this, view);
        mTopBar.setTitle("消息中心");
        if (mMsgSections.isEmpty()) {


            mMsgSections.add(new MsgSection(MatterNoticeActivity.class, "待办事项", "ic_remind"));
            mMsgSections.add(new MsgSection(SampleNoticeActivity.class, "通知", "ic_notice"));
            mMsgSections.add(new MsgSection(MatterNoticeActivity.class, "生日提醒", "ic_gift"));
            mMsgSections.add(new MsgSection(MatterNoticeActivity.class, "异常处理", "ic_error_notice"));


        }
        mMsgSectionAdapter = new MsgSectionAdapter(mMsgSections);
        mRvMsgSection.setLayoutManager(new LinearLayoutManager(getContext()));
        mRvMsgSection.setAdapter(mMsgSectionAdapter);
        showContent(false);
    }

    @Override
    public void initData() {

    }

    public void refreshNoticeState() {
        mMsgSectionAdapter.notifyDataSetChanged();
    }


}
